package org.edu.modules.stu.zhsz.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.edu.common.base.BasePageDto;
import org.edu.modules.stu.zhsz.entity.VeStuCheckStudent;
import org.edu.modules.stu.zhsz.dto.VeStuCheckStudentDto;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;

import java.util.List;

/**
 * dao-被评测的学生
 */
public interface VeStuCheckStudentMapper extends BaseMapper<VeStuCheckStudent> {
    /**
     * 查询DTO 的分页
     **/
    IPage<VeStuCheckStudentDto> pageDto(BasePageDto page, @Param(Constants.WRAPPER) Wrapper queryWrapper);
    /**
     * 查询DTO 的分页
     **/
    List<VeStuCheckStudentDto> findStu(Integer stuId);

    @Delete("delete from ve_stu_check_student where item_id = ${pid}")
    void  deleteByPid(String pid);

    @Delete("update ve_stu_check_student set status =2 where item_id = ${itemId} and stu_id = ${stuId}")
    void  updateByTwo(@Param("itemId") String itemId,@Param("stuId") String stuId);
}
